//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package upgrade

import (
	"context"

	"atomgit.com/openlinksaas/api-server/dao"
)

type UpToVer37 struct{}

func (up *UpToVer37) Exec(ctx context.Context) error {
	exist, err := dao.VersionDao.Exist(ctx, dao.VERSION_KEY_KEYWORD)
	if err != nil {
		return err
	}
	if !exist {
		err = dao.VersionDao.Set(ctx, dao.VERSION_KEY_KEYWORD, 1)
		if err != nil {
			return err
		}
	}
	return dao.VersionDao.Set(ctx, dao.VERSION_KEY_SCHEMA, 37)
}
